<template>
  <view>
    <web-view :src="src"></web-view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      src: ""
    };
  },
  onTabItemTap(item) {
    wx.showLoading({
      title: "加载中",
      mask: true
    });
    const { token } = wx.getStorageSync("userInfo");
    if (!token) {
      wx.hideLoading();
      uni.navigateTo({
        url: "../login/index"
      });
    } else {
      this.$axios({
        url: "api/index/footerTab",
        data: {
          token
        }
      }).then(res => {
        const { returnData } = res.data;
        wx.hideLoading();
        this.src = returnData[item.index].url;
      });
    }
  }
};
</script>